package com.example.yuan0602;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import android.widget.Toast;

import java.io.Serializable;

public class MyService extends Service {
    public MyService() {
    }

    @Override
    public IBinder onBind(Intent intent) {
        // TODO: Return the communication channel to the service.
        throw new UnsupportedOperationException("enaf");
    }

    @Override
    public void onCreate() {
        super.onCreate();

    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        String se = (String) intent.getSerializableExtra(ServiceActivity.FLAG);
        Toast.makeText(this, se, Toast.LENGTH_SHORT).show();
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onDestroy() {
        Log.e("s", "onDestroy: ");
        super.onDestroy();

    }
    private void fun(){
        Toast.makeText(this, "", Toast.LENGTH_SHORT).show();
    }
}
